<?php
header("Content-Type: text/html; charset=iso-8859-1");
require_once('include.php');
#session_start();
$navigations = array(
	"accueil" => "index.php",
	"infos et documents" => "infos.php",
	"inscriptions" => "inscriptions.php",
	"&eacute;quipes" => "equipes.php",
	"membres" => "membre.php",
	"arbitrages" => "arbitrages.php",
	"marquages" => "marquages.php",
	"historique" => "historique.php",
	"partenaires" => "partenaires.php",
	"photos" => "photos.php",
	"contacts" => "contacts.php" 
);

foreach($navigations as $print => $link){
	${"nav_$print"} = array();
}

$nav_accueil = array(
	"derni&egrave;res infos" => "#infos",
	"derniers r&eacute;sultats" => "#resultats",
	"prochains matchs" => "#matchs"
);

${"nav_infos et documents"} = array(
	"les infos" => "infos.php"
);
$q = "select id from documents where valide = 1 order by nom";
$r = ExecRequete($q);
while($s = LigneSuivante($r)){
	$file = new document($s->id);
	${"nav_infos et documents"}[$file->icon()." $file->nom"] = $file->fichier;
	
}

$nav_id = (!isset($_SESSION['navigation'])) ? "accueil" : $_SESSION['navigation'];
echo "<ul class = 'nav'>\n";
foreach($navigations as $key => $val){
	$selected = ($key == $nav_id) ? "<div class = 'bullet' style = 'position: absolute; left: -20px; width: 7px; height: 14px; background-color: #CC2C30; color: #CC2C30;font-size: 8px'>&nbsp;</div>" : "<span style = 'width: 12px;'>&nbsp;</span>";
	echo "<li>$selected ".(lien($val,$key));
	if($key == $nav_id){
		if(is_array(${"nav_".$key})){
			echo "<ul class = 'nav sous'>\n";
			foreach(${"nav_".$key} as $subkey => $subval){
				echo "<li>".(lien($subval,$subkey))."</li>\n";
			}
			echo "</ul>\n";
		}
	}
	echo "</li>\n";
}
echo "</ul>\n";
?>